﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcApplication5.Common
{
    public class AppContextManager :IHttpModule
    {
        HttpApplication _httpApplication;

        public void Dispose()
        {
            
        }

        public void Init(HttpApplication context)
        {
            _httpApplication = context;
            _httpApplication.BeginRequest += new EventHandler(Application_BeginRequest);
        }

        private void Application_BeginRequest(object source, EventArgs e)
        {
            new AppContext(_httpApplication.Context);
        }
    }
}